package inv.cal.view;

import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableCellRenderer;


public class NumberCellRenderer extends DefaultTableCellRenderer {
	private static final long serialVersionUID = -3867645931030711478L;
	
	public NumberCellRenderer() {
		super();
		
	}

	@Override
	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {
		Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus,
				row, column);
		
		if(c instanceof JLabel){
			JLabel label	= (JLabel)c;
			label.setHorizontalAlignment(SwingConstants.RIGHT);
		}
		
		return c;
	}
	
}
